package com.tanhua.server.controller;

import com.tanhua.autoconfig.vo.HuanXinUser;
import com.tanhua.server.utils.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/huanxin")
public class HuanxinController {

//    请求方式  GET
//    请求地址  /huanxin/user
//    请求参数  token
//    返回结果  {username:USERID,password:123456}
//    /huanxin/user
    @GetMapping(value = "/user",name ="获取环信用户信息" )
    public ResponseEntity user(){
        System.out.println("获取环信用户信息.............");
        HuanXinUser huanXinUser = new HuanXinUser(UserHolder.getUserId().toString(),"123456");
        return ResponseEntity.ok(huanXinUser);
    }
}
